package com.hymjweb.demo;

import com.hymjweb.demo.framework.util.DateUtil;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class MainTest1 {

    public static void main(String[] args) throws ParseException {

        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date date = df.parse("2029-12-30");

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);

        long time = calendar.getTimeInMillis();

        System.out.println(time);

        System.out.println(System.currentTimeMillis());

        String sd = df.format(new Date(Long.parseLong(String.valueOf(time))));

        System.out.println(sd);


        // 1635696000000
        System.out.println(DateUtil.diffDate(1635696000000L,System.currentTimeMillis()));


    }

}
